package tests;

import static org.junit.Assert.*;
/**
 * This class tests the UserAccount class
 * 
 * @author buthainahaldosary
 * @since May 2013
 *
 */

import model.UserAccount;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class TestUserAccount {

	UserAccount account;
	/**
	 * This method is called before every test case.
	 */
	@Before
	public void setUp()
	{
		account=new UserAccount("User1");
	}
	/**
	 * This method is called after every test case.
	 */
	@After
	public void tearDown()
	{
		account=null;
		System.gc();
	}
	/**
	 * This test case tests the setError method
	 */
	@Test
	public void testSetError() {
		account.setError("Error");
		assertEquals("Error",account.getError());
	}
	/**
	 * This test case tests the getError method	
	 */
	@Test
	public void testGetError() {
		account.setError("New Error");
		assertEquals("New Error",account.getError());
	}


}
